#pragma once
#include "qcontrol.h"


#pragma warning( disable: 4800)

namespace micro
{
namespace gui
{



class QMonthCalendar :    public QControl
{
public:


    // Constructors
    QMonthCalendar( HWND hWnd = NULL )
    {
        _window = hWnd;
    }
    virtual ~QMonthCalendar( void );
    QMonthCalendar & operator=( HWND hWnd )
    {
        _window = hWnd;
        return *this;
    }

    HWND Create( HWND hWndParent, RECT & rcPos, LPCTSTR szWindowName = NULL,
                 DWORD dwStyle = 0, DWORD dwExStyle = 0,
                 UINT nID = 0, LPVOID lpCreateParam = NULL )
    {
        return 0;//CWindow::Create( GetWndClassName(), hWndParent, rcPos, szWindowName, dwStyle, dwExStyle, nID, lpCreateParam );
    }
    HWND Create( HWND hWndParent, LPRECT lpRect = NULL, LPCTSTR szWindowName = NULL,
                 DWORD dwStyle = 0, DWORD dwExStyle = 0,
                 HMENU hMenu = NULL, LPVOID lpCreateParam = NULL )
    {
        return 0;//CWindow::Create( GetWndClassName(), hWndParent, lpRect, szWindowName, dwStyle, dwExStyle, hMenu, lpCreateParam );
    }

    // Attributes
    virtual LPCTSTR GetWndClassName()
    {
        return MONTHCAL_CLASS;
    }

    COLORREF GetColor( int nColorType ) const
    {
        ASSERT( IsWindow() );
        return ( COLORREF )::SendMessage( _window, MCM_GETCOLOR, nColorType, 0L );
    }
    COLORREF SetColor( int nColorType, COLORREF clr )
    {
        ASSERT( IsWindow() );
        return ( COLORREF )::SendMessage( _window, MCM_SETCOLOR, nColorType, clr );
    }
    bool GetCurSel( LPSYSTEMTIME lpSysTime ) const
    {
        ASSERT( IsWindow() );
        return ( bool )::SendMessage( _window, MCM_GETCURSEL, 0, ( LPARAM )lpSysTime );
    }
    bool SetCurSel( LPSYSTEMTIME lpSysTime )
    {
        ASSERT( IsWindow() );
        return ( bool )::SendMessage( _window, MCM_SETCURSEL, 0, ( LPARAM )lpSysTime );
    }
    int GetFirstDayOfWeek( bool * pbLocaleVal = NULL ) const
    {
        ASSERT( IsWindow() );
        DWORD dwRet = ::SendMessage( _window, MCM_GETFIRSTDAYOFWEEK, 0, 0L );

        if ( pbLocaleVal != NULL )
            *pbLocaleVal = HIWORD( dwRet );

        return ( int )LOWORD( dwRet );
    }
    int SetFirstDayOfWeek( int nDay, bool * pbLocaleVal = NULL )
    {
        ASSERT( IsWindow() );
        DWORD dwRet = ::SendMessage( _window, MCM_SETFIRSTDAYOFWEEK, 0, nDay );

        if ( pbLocaleVal != NULL )
            *pbLocaleVal = HIWORD( dwRet );

        return ( int )LOWORD( dwRet );
    }
    int GetMaxSelCount() const
    {
        ASSERT( IsWindow() );
        return ( int )::SendMessage( _window, MCM_GETMAXSELCOUNT, 0, 0L );
    }
    bool SetMaxSelCount( int nMax )
    {
        ASSERT( IsWindow() );
        return ( bool )::SendMessage( _window, MCM_SETMAXSELCOUNT, nMax, 0L );
    }
    int GetMonthDelta() const
    {
        ASSERT( IsWindow() );
        return ( int )::SendMessage( _window, MCM_GETMONTHDELTA, 0, 0L );
    }
    int SetMonthDelta( int nDelta )
    {
        ASSERT( IsWindow() );
        return ( int )::SendMessage( _window, MCM_SETMONTHDELTA, nDelta, 0L );
    }
    DWORD GetRange( LPSYSTEMTIME lprgSysTimeArray ) const
    {
        ASSERT( IsWindow() );
        return ::SendMessage( _window, MCM_GETRANGE, 0, ( LPARAM )lprgSysTimeArray );
    }
    bool SetRange( DWORD dwFlags, LPSYSTEMTIME lprgSysTimeArray )
    {
        ASSERT( IsWindow() );
        return ( bool )::SendMessage( _window, MCM_SETRANGE, dwFlags, ( LPARAM )lprgSysTimeArray );
    }
    bool GetSelRange( LPSYSTEMTIME lprgSysTimeArray ) const
    {
        ASSERT( IsWindow() );
        return ( bool )::SendMessage( _window, MCM_GETSELRANGE, 0, ( LPARAM )lprgSysTimeArray );
    }
    bool SetSelRange( LPSYSTEMTIME lprgSysTimeArray )
    {
        ASSERT( IsWindow() );
        return ( bool )::SendMessage( _window, MCM_SETSELRANGE, 0, ( LPARAM )lprgSysTimeArray );
    }
    bool GetToday( LPSYSTEMTIME lpSysTime ) const
    {
        ASSERT( IsWindow() );
        return ( bool )::SendMessage( _window, MCM_GETTODAY, 0, ( LPARAM )lpSysTime );
    }
    void SetToday( LPSYSTEMTIME lpSysTime )
    {
        ASSERT( IsWindow() );
        ::SendMessage( _window, MCM_SETTODAY, 0, ( LPARAM )lpSysTime );
    }
    bool GetMinReqRect( LPRECT lpRectInfo ) const
    {
        ASSERT( IsWindow() );
        return ( bool )::SendMessage( _window, MCM_GETMINREQRECT, 0, ( LPARAM )lpRectInfo );
    }

    // Operations
    int GetMonthRange( DWORD dwFlags, LPSYSTEMTIME lprgSysTimeArray ) const
    {
        ASSERT( IsWindow() );
        return ( int )::SendMessage( _window, MCM_GETMONTHRANGE, dwFlags, ( LPARAM )lprgSysTimeArray );
    }
    bool SetDayState( int nMonths, LPMONTHDAYSTATE lpDayStateArray )
    {
        ASSERT( IsWindow() );
        return ( bool )::SendMessage( _window, MCM_SETDAYSTATE, nMonths, ( LPARAM )lpDayStateArray );
    }
    DWORD HitTest( PMCHITTESTINFO pMCHitTest ) const
    {
        ASSERT( IsWindow() );
        return ::SendMessage( _window, MCM_HITTEST, 0, ( LPARAM )pMCHitTest );
    }
};

}
}